package org.openwork.portlet.skillmanagement.service.base;

import com.liferay.counter.service.CounterLocalService;

import com.liferay.portal.kernel.annotation.BeanReference;
import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.service.ResourceLocalService;
import com.liferay.portal.service.ResourceService;
import com.liferay.portal.service.UserLocalService;
import com.liferay.portal.service.UserService;
import com.liferay.portal.service.base.PrincipalBean;
import com.liferay.portal.service.persistence.ResourcePersistence;
import com.liferay.portal.service.persistence.UserPersistence;

import org.openwork.portlet.skillmanagement.service.SkillCategoryLocalService;
import org.openwork.portlet.skillmanagement.service.SkillCategoryService;
import org.openwork.portlet.skillmanagement.service.SkillLocalService;
import org.openwork.portlet.skillmanagement.service.SkillService;
import org.openwork.portlet.skillmanagement.service.SkillUserLocalService;
import org.openwork.portlet.skillmanagement.service.SkillUserService;
import org.openwork.portlet.skillmanagement.service.persistence.SkillCategoryPersistence;
import org.openwork.portlet.skillmanagement.service.persistence.SkillPersistence;
import org.openwork.portlet.skillmanagement.service.persistence.SkillUserPersistence;

import javax.sql.DataSource;


public abstract class SkillUserServiceBaseImpl extends PrincipalBean
    implements SkillUserService {
    @BeanReference(type = SkillCategoryLocalService.class)
    protected SkillCategoryLocalService skillCategoryLocalService;
    @BeanReference(type = SkillCategoryService.class)
    protected SkillCategoryService skillCategoryService;
    @BeanReference(type = SkillCategoryPersistence.class)
    protected SkillCategoryPersistence skillCategoryPersistence;
    @BeanReference(type = SkillLocalService.class)
    protected SkillLocalService skillLocalService;
    @BeanReference(type = SkillService.class)
    protected SkillService skillService;
    @BeanReference(type = SkillPersistence.class)
    protected SkillPersistence skillPersistence;
    @BeanReference(type = SkillUserLocalService.class)
    protected SkillUserLocalService skillUserLocalService;
    @BeanReference(type = SkillUserService.class)
    protected SkillUserService skillUserService;
    @BeanReference(type = SkillUserPersistence.class)
    protected SkillUserPersistence skillUserPersistence;
    @BeanReference(type = CounterLocalService.class)
    protected CounterLocalService counterLocalService;
    @BeanReference(type = ResourceLocalService.class)
    protected ResourceLocalService resourceLocalService;
    @BeanReference(type = ResourceService.class)
    protected ResourceService resourceService;
    @BeanReference(type = ResourcePersistence.class)
    protected ResourcePersistence resourcePersistence;
    @BeanReference(type = UserLocalService.class)
    protected UserLocalService userLocalService;
    @BeanReference(type = UserService.class)
    protected UserService userService;
    @BeanReference(type = UserPersistence.class)
    protected UserPersistence userPersistence;

    public SkillCategoryLocalService getSkillCategoryLocalService() {
        return skillCategoryLocalService;
    }

    public void setSkillCategoryLocalService(
        SkillCategoryLocalService skillCategoryLocalService) {
        this.skillCategoryLocalService = skillCategoryLocalService;
    }

    public SkillCategoryService getSkillCategoryService() {
        return skillCategoryService;
    }

    public void setSkillCategoryService(
        SkillCategoryService skillCategoryService) {
        this.skillCategoryService = skillCategoryService;
    }

    public SkillCategoryPersistence getSkillCategoryPersistence() {
        return skillCategoryPersistence;
    }

    public void setSkillCategoryPersistence(
        SkillCategoryPersistence skillCategoryPersistence) {
        this.skillCategoryPersistence = skillCategoryPersistence;
    }

    public SkillLocalService getSkillLocalService() {
        return skillLocalService;
    }

    public void setSkillLocalService(SkillLocalService skillLocalService) {
        this.skillLocalService = skillLocalService;
    }

    public SkillService getSkillService() {
        return skillService;
    }

    public void setSkillService(SkillService skillService) {
        this.skillService = skillService;
    }

    public SkillPersistence getSkillPersistence() {
        return skillPersistence;
    }

    public void setSkillPersistence(SkillPersistence skillPersistence) {
        this.skillPersistence = skillPersistence;
    }

    public SkillUserLocalService getSkillUserLocalService() {
        return skillUserLocalService;
    }

    public void setSkillUserLocalService(
        SkillUserLocalService skillUserLocalService) {
        this.skillUserLocalService = skillUserLocalService;
    }

    public SkillUserService getSkillUserService() {
        return skillUserService;
    }

    public void setSkillUserService(SkillUserService skillUserService) {
        this.skillUserService = skillUserService;
    }

    public SkillUserPersistence getSkillUserPersistence() {
        return skillUserPersistence;
    }

    public void setSkillUserPersistence(
        SkillUserPersistence skillUserPersistence) {
        this.skillUserPersistence = skillUserPersistence;
    }

    public CounterLocalService getCounterLocalService() {
        return counterLocalService;
    }

    public void setCounterLocalService(CounterLocalService counterLocalService) {
        this.counterLocalService = counterLocalService;
    }

    public ResourceLocalService getResourceLocalService() {
        return resourceLocalService;
    }

    public void setResourceLocalService(
        ResourceLocalService resourceLocalService) {
        this.resourceLocalService = resourceLocalService;
    }

    public ResourceService getResourceService() {
        return resourceService;
    }

    public void setResourceService(ResourceService resourceService) {
        this.resourceService = resourceService;
    }

    public ResourcePersistence getResourcePersistence() {
        return resourcePersistence;
    }

    public void setResourcePersistence(ResourcePersistence resourcePersistence) {
        this.resourcePersistence = resourcePersistence;
    }

    public UserLocalService getUserLocalService() {
        return userLocalService;
    }

    public void setUserLocalService(UserLocalService userLocalService) {
        this.userLocalService = userLocalService;
    }

    public UserService getUserService() {
        return userService;
    }

    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    public UserPersistence getUserPersistence() {
        return userPersistence;
    }

    public void setUserPersistence(UserPersistence userPersistence) {
        this.userPersistence = userPersistence;
    }

    protected void runSQL(String sql) throws SystemException {
        try {
            DataSource dataSource = skillUserPersistence.getDataSource();

            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                    sql, new int[0]);

            sqlUpdate.update();
        } catch (Exception e) {
            throw new SystemException(e);
        }
    }
}
